<?php

namespace App\Model;


class UserVerify extends BaseModel
{
    protected $table = 'user_verify';

    public function getActiveCertifyInfoByUserId($number_id){
        return self::where('user_id', $number_id)->where('result_code',1000)->first(['idcard_name', 'idcard_number']);
    }

    public function getActiveCertifyInfoByUserIds($user_ids){
        $res = self::whereIn('user_id', $user_ids)->where('result_code',1000)
            ->get(['user_id','idcard_number']);
        return $this->objToArray($res) ?? [];
    }

    public function getIdcardNum($idCard)
    {
        return self::where('idcard_number', $idCard)->where('result_code',1000)
            ->count();
    }
}
